Different portable electronic devices, such as smart phones and tablet computers, are used more and more widely. However, because power stored in a battery of the portable electronic is limited, the portable electronic device can not used for a long time and needs to be charged frequently. Therefore, a charger needs to be carried with the portable electronic devices, which is troublesomely. For handily charging the portable electronic device, the USB port on computer is used to charge the portable electronic device. However, because the USB port is always provided with electric power, it is easy to damage the portable electronic device when the portable electronic device is mis-plugged in the USB port. Thus, there is room for improvement in the art.